<template>
  <div>
    <h1>app组件</h1>
    <hr />
    <Test ref="yyy"></Test>
  </div>
</template>

<script>
import Test from './components/Test.vue'
export default {
  components: {
    Test,
  },
  methods: {
    handle(data) {
      console.log(data)
    },
  },

  mounted() {
    // app要接收事件总线方式传递的数据,所以在app中给$bus绑定自定义事件
    this.$bus.$on('test', this.handle)
  },
}
</script>

<style></style>
